package com.websuites.ejb.jndi;

import com.websuites.utils.LogUtil;

public class JNDIFactory {   
    public final static String JBOSS_SERVER = "jboss";   
    public final static String GLASSFISH_SERVER = "glassfish"; 
    
    public static JNDIFinder getFinder(String server) {   
    	LogUtil.info("server is "+server);
        if (JBOSS_SERVER.equals(server)) {   
        	LogUtil.info("call jboss lookup");   
            return new JbossJNDIFinderImpl();   
        }else if (GLASSFISH_SERVER.equals(server)) {   
        	LogUtil.info("call glassfish lookup");   
            return new GlassfishJNDIFinderImpl();
        }
        //default
        return new JbossJNDIFinderImpl();  
    }   
}  